package com.jeesite.modules.rt.service;

import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.rt.entity.RtDeviceShouyi;
import com.jeesite.modules.rt.dao.RtDeviceShouyiDao;

/**
 * 收益Service
 * @author 李寒冰
 * @version 2024-10-16
 */
@Service
public class RtDeviceShouyiService extends CrudService<RtDeviceShouyiDao, RtDeviceShouyi> {

	public RtDeviceShouyi getPaoliangBySnDate(String sn,String date){
		RtDeviceShouyi rtDeviceShouyi = new RtDeviceShouyi();
		rtDeviceShouyi.setSn(sn);
		rtDeviceShouyi.setWorkDateEq(date);
		List<RtDeviceShouyi> list = dao.findList(rtDeviceShouyi);
		if(list != null && list.size() > 0){
			return list.get(0);
		}
		return null;
	}
	
	/**
	 * 获取单条数据
	 * @param rtDeviceShouyi
	 * @return
	 */
	@Override
	public RtDeviceShouyi get(RtDeviceShouyi rtDeviceShouyi) {
		return super.get(rtDeviceShouyi);
	}
	
	/**
	 * 查询分页数据
	 * @param rtDeviceShouyi 查询条件
	 * @param rtDeviceShouyi page 分页对象
	 * @return
	 */
	@Override
	public Page<RtDeviceShouyi> findPage(RtDeviceShouyi rtDeviceShouyi) {
		return super.findPage(rtDeviceShouyi);
	}
	
	/**
	 * 查询列表数据
	 * @param rtDeviceShouyi
	 * @return
	 */
	@Override
	public List<RtDeviceShouyi> findList(RtDeviceShouyi rtDeviceShouyi) {
		return super.findList(rtDeviceShouyi);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param rtDeviceShouyi
	 */
	@Override
	@Transactional
	public void save(RtDeviceShouyi rtDeviceShouyi) {
		super.save(rtDeviceShouyi);
	}
	
	/**
	 * 更新状态
	 * @param rtDeviceShouyi
	 */
	@Override
	@Transactional
	public void updateStatus(RtDeviceShouyi rtDeviceShouyi) {
		super.updateStatus(rtDeviceShouyi);
	}
	
	/**
	 * 删除数据
	 * @param rtDeviceShouyi
	 */
	@Override
	@Transactional
	public void delete(RtDeviceShouyi rtDeviceShouyi) {
		super.delete(rtDeviceShouyi);
	}
	
}